home *** CD-ROM | disk | FTP | other *** search
- unit Info;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls, NCTAUDIOEDITOR2Lib_TLB;
-
- type
- TfrmInfo = class(TForm)
- Label5: TLabel;
- infoTitle: TEdit;
- Label6: TLabel;
- infoArtist: TEdit;
- Label7: TLabel;
- infoAlbum: TEdit;
- Label12: TLabel;
- infoGenre: TComboBox;
- Label8: TLabel;
- infoCopyright: TEdit;
- Label9: TLabel;
- infoYear: TEdit;
- Label10: TLabel;
- infoTrack: TEdit;
- Label11: TLabel;
- infoComment: TEdit;
- btnApply: TButton;
- btnReset: TButton;
- infoMTV: TRadioGroup;
- Label3: TLabel;
- infoComposer: TEdit;
- Label4: TLabel;
- infoEncodedBy: TEdit;
- Label13: TLabel;
- infoURL: TEdit;
- procedure btnResetClick(Sender: TObject);
- procedure btnApplyClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- procedure ResetData;
- public
- { Public declarations }
- Info: IAudioEditor2FileInfo;
- end;
-
- var
- frmInfo: TfrmInfo;
-
- implementation
-
- uses Main;
-
- {$R *.dfm}
- //---------------------------------------------------------------------------
-
- procedure TfrmInfo.ResetData;
- begin
- infoTitle.Text := Info.Title;
- infoArtist.Text := Info.Artist;
- infoAlbum.Text := Info.Album;
- infoGenre.ItemIndex := Info.Genre;
- infoCopyright.Text := Info.Copyright;
- infoComment.Text := Info.Comments;
- infoYear.Text := IntToStr(Info.Year);
- infoTrack.Text := IntToStr(Info.Track);
- infoComposer.Text := Info.Composer;
- infoURL.Text := Info.URL;
- infoEncodedBy.Text := Info.EncodedBy;
- end;
- procedure TfrmInfo.btnResetClick(Sender: TObject);
- begin
- ResetData();
- end;
- //---------------------------------------------------------------------------
- procedure TfrmInfo.btnApplyClick(Sender: TObject);
- begin
- Info.set_Title(StringToOleStr(infoTitle.Text)); //Sets a new title of the audio file subject
- Info.set_Artist(StringToOleStr(infoArtist.Text)); //Sets a new name of the artist who created the original subject of the file
- Info.set_Album(StringToOleStr(infoAlbum.Text)); //Sets a new Album name which contains the original audio file subject
- Info.Genre := infoGenre.ItemIndex; //Sets a new user-defined genre of the audio subject
- Info.set_Copyright(StringToOleStr(infoCopyright.Text)); //Sets new copyright information for the audio file
- Info.set_Comments(StringToOleStr(infoComment.Text)); //Sets new user-defined comments concerning an audio file
- try
- Info.Year := StrToInt(infoYear.Text); //Sets the new year of the audio file//s subject to be first performed
- except
- ShowMessage('Invalid Year Value');
- infoYear.SetFocus();
- Exit;
- end;
- try
- Info.Track := StrToInt(infoTrack.Text);
- except
- ShowMessage('Invalid Track Value');
- infoTrack.SetFocus();
- Exit;
- end;
- Info.set_URL(StringToOleStr(infoURL.Text));
- Info.set_Composer(StringToOleStr(infoComposer.Text));
- Info.set_EncodedBy(StringToOleStr(infoEncodedBy.Text));
- end;
- //---------------------------------------------------------------------------
- procedure TfrmInfo.FormShow(Sender: TObject);
- begin
- Info := frmMain.AudioEditor1.FileInfo;
- ResetData();
- end;
- //---------------------------------------------------------------------------
- procedure TfrmInfo.FormCreate(Sender: TObject);
- var
- i: Integer;
- begin
- for i := 0 to 141 do begin
- //The list of genres is being filled with 148 elements using this cycle
- infoGenre.Items.Add(frmMain.AudioEditor1.FileInfo.GenreToString(i));
- end;
- end;
- //---------------------------------------------------------------------------
- end.
-